//
//  MyLifeTableViewCell.m
//  ForengnMenu
//
//  Created by 请叫我雷锋 on 16/1/20.
//  Copyright © 2016年 余旺. All rights reserved.
//

#import "MyLifeTableViewCell.h"

@implementation MyLifeTableViewCell

- (void)awakeFromNib {
    self.headView.layer.cornerRadius=self.headView.frame.size.height/2.0f;
    self.headView.layer.masksToBounds=YES;
    self.nameLabel.font=[UIFont systemFontOfSize:14];
    self.timeLabel.font=[UIFont systemFontOfSize:11];
    self.contentLabel.font=[UIFont systemFontOfSize:14];
    self.zanLabel2.textColor=[UIColor colorWithRed:90/255.0f green:150/255.0f blue:201/255.0f alpha:1];
    self.browseLabel.textColor=[UIColor colorWithRed:90/255.0f green:150/255.0f blue:201/255.0f alpha:1];
    
    //轻敲手势
    UITapGestureRecognizer * tap =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapAction:)];
    
    //手指数量
    tap.numberOfTouchesRequired=1;
    
    //连击次数
    tap.numberOfTapsRequired=1;
    
    //添加到图片上面去
    [self.middleView addGestureRecognizer:tap];
    
    //让图片响应手势
    self.middleView.userInteractionEnabled=YES;
    
    
    
    //轻敲手势
    UITapGestureRecognizer * tap2 =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tAction:)];
    
    //手指数量
    tap2.numberOfTouchesRequired=1;
    
    //连击次数
    tap2.numberOfTapsRequired=1;
    
    //添加到图片上面去
    [self.middleView2 addGestureRecognizer:tap2];
    
    //让图片响应手势
    self.middleView2.userInteractionEnabled=YES;

    
    
}
- (IBAction)zanLoveAction:(UIButton *)sender {
    
    if (sender.tag == 0) {
        sender.tag = 1;
        int a = [self.zanLabel.text intValue];
        a++;
        self.zanLabel.text=[NSString stringWithFormat:@"%d",a];
        NSLog(@"a");
        
    }else{
        sender.tag =0;
        int b =[self.zanLabel.text intValue];
        b--;
        self.zanLabel.text=[NSString stringWithFormat:@"%d",b];
        NSLog(@"b");
        
    }
    
    [self.delegate zanZanWithCell:self];
    
}

-(void)tapAction:(UIGestureRecognizer *)tap{
    
    [self.delegate tapAction];
    
}


-(void)tAction:(UIGestureRecognizer *)tap2{
    
    [self.delegate tAction];
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
